import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component:Index,
    children:[
      {
        path:'/',
        redirect:'/home'
      },
      {
      path:"/home",
      name:'Home',
      component:()=>import("../views/Home.vue")
    },{
      path:"/sort",
      name:'Sort',
      component:()=>import("../views/Sort.vue")
    },{
      path:"/shoppingcart",
      name:'ShoppingCart',
      component:()=>import("../views/ShoppingCart.vue")
    },{
      path:"/me",
      name:'Me',
      component:()=>import("../views/Me.vue")
    }]
  }
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
